home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_09_06
/
9n06048a
< prev
next >
Wrap
Text File
|
1991-04-14
|
1KB
|
39 lines
/* -------------------------------------------------------------------- */
/* Listing 1 - declarations */
/* structure for function table */
struct func_list {
char *funcname; /* pointer to function's name */
struct param *(*func)(); /* pointer to function */
} ;
/* structure to hold parameter & return values */
struct param {
int datatype;
union {
char cparam;
char *sparam;
int iparam;
long lparam;
float fparam;
/* other types could be added */
} value;
} ;
/* data types */
#define CHAR 1
#define STRING 2
#define INTEGER 3
/* etc. */
/* function prototypes */
/* to call user function */
struct param *call_ufunc(char *ufuncname,struct param args[],int num_args);
/* to search function table */
struct param *(*lookup(char *funcname, struct func_list functab[]))();
/* user function prototypes */
struct param *myfunc(struct param *sparm);